Patent document 1 describes an internal combustion engine that includes a variable valve timing mechanism. The variable valve timing mechanism includes a first rotary body, which rotates in cooperation with the rotation of a crankshaft, and a second rotary body, which rotates together with a camshaft. The variable valve timing mechanism uses hydraulic pressure, which is supplied from a hydraulic control valve to advancing chambers and retarding chambers, to change the rotation phase of the second rotary body relative to the first rotary body and vary the valve timing of engine valves. The control amount (duty) of the hydraulic control valve is set based on a feedback control amount, which is calculated based on the deviation of the actual valve timing from the target valve timing, and a holding control amount (hold duty), which is used to hold the actual valve timing at a constant timing.
The variable valve timing mechanism described in patent document 1 also includes a spring that urges the second rotary body to a position at which the rotation phase of the second rotary body relative to the first rotary body corresponds to a predetermined phase between the most retarded phase and the most advanced phase. Additionally, the variable valve timing mechanism may include, for example, a lock mechanism that fixes the relative rotation phase at a predetermined phase that is suitable for starting the engine. In this case, even if the relative rotation phase is not fixed by the lock mechanism when the engine stalls and stops, the urging force of the spring allows the relative rotation phase to be set in the predetermined phase, which can be fixed by the lock mechanism.
The above relative rotation phase includes a spring region, in which the second rotary body receives the urging force of the spring, and a non-spring region, in which the second rotary body does not receive the urging force of the spring. The control amount of the hydraulic control valve that is needed to hold the actual valve timing at a constant timing when the relative rotation phase is in the spring region differs from that when the relative rotation phase is in the non-spring region. In addition to the difference between the spring region and the non-spring region, the control amount of the hydraulic control valve that is needed to hold the actual valve timing at the constant timing also differs depending on the present operation state of the variable valve timing mechanism, such as the viscosity of the hydraulic oil. Thus, the control device of the internal combustion engine described in patent document 1 performs a learning process, in which the control device learns that a holding control amount is the control amount that holds the actual valve timing at the constant valve timing when the relative rotation phase of the first rotary body and the second rotary body is in the spring region and when the relative rotation phase is in the non-spring region.